home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / p_man / cat3p / pthread_create.z / pthread_create
Encoding:
Text File  |  2001-04-17  |  5.1 KB  |  133 lines

  1.  
  2.  
  3.  
  4. pppptttthhhhrrrreeeeaaaadddd____ccccrrrreeeeaaaatttteeee((((3333PPPP))))                                          pppptttthhhhrrrreeeeaaaadddd____ccccrrrreeeeaaaatttteeee((((3333PPPP))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      pthread_create - create and start a thread
  10.  
  11. CCCC SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      ####iiiinnnncccclllluuuuddddeeee <<<<pppptttthhhhrrrreeeeaaaadddd....hhhh>>>>
  13.  
  14.      iiiinnnntttt pppptttthhhhrrrreeeeaaaadddd____ccccrrrreeeeaaaatttteeee((((pppptttthhhhrrrreeeeaaaadddd____tttt ****tttthhhhrrrreeeeaaaadddd,,,, pppptttthhhhrrrreeeeaaaadddd____aaaattttttttrrrr____tttt ****aaaattttttttrrrr,,,,
  15.           vvvvooooiiiidddd ****((((****ssssttttaaaarrrrtttt))))((((vvvvooooiiiidddd ****)))),,,, vvvvooooiiiidddd ****aaaarrrrgggg))));;;;
  16.  
  17. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  18.      The _p_t_h_r_e_a_d__c_r_e_a_t_e() function creates a thread with the attributes
  19.      specified by _a_t_t_r, starting execution at the function named _s_t_a_r_t with
  20.      the argument value _a_r_g.  A null value of _a_t_t_r causes the thread to be
  21.      created with default attributes.  The thread identity is saved in the
  22.      location pointed to by the _t_h_r_e_a_d argument.
  23.  
  24.      A new thread inherits its per-thread signal mask from its creator.  No
  25.      signals are pending on the thread when it starts.  The thread runs until
  26.      it returns from its _s_t_a_r_t function, calls _p_t_h_r_e_a_d__e_x_i_t(), or acts on a
  27.      cancellation request.  The exception is the initial thread which will
  28.      cause the process to exit if it returns from _m_a_i_n().  When the process
  29.      terminates so do all its threads.
  30.  
  31.      For an overview of POSIX threads see _p_t_h_r_e_a_d_s(5).
  32.  
  33. DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
  34.      On success, _p_t_h_r_e_a_d__c_r_e_a_t_e() returns zero; otherwise an error number is
  35.      returned:
  36.  
  37.      [[[[EEEEAAAAGGGGAAAAIIIINNNN]]]]       The maximum number of threads has been created [see NNNNOOOOTTTTEEEESSSS,
  38.                     and _s_e_t_r_l_i_m_i_t()] or there is insufficient memory to create
  39.                     the thread.
  40.  
  41.      [[[[EEEEPPPPEEEERRRRMMMM]]]]        The calling process lacks sufficient privilege to create a
  42.                     thread with these attributes [see
  43.                     _p_t_h_r_e_a_d__a_t_t_r__s_e_t_s_c_o_p_e()].
  44.  
  45.      [[[[EEEEPPPPEEEERRRRMMMM]]]]        A call to _p_t_h_r_e_a_d__c_r_e_a_t_e() was attempted from a sproc
  46.                     program (see CCCCAAAAVVVVEEEEAAAATTTTSSSS, section below).
  47.  
  48.      [[[[EEEEPPPPEEEERRRRMMMM]]]]        A call to _p_t_h_r_e_a_d__c_r_e_a_t_e() was attempted with a priority
  49.                     that is outside of the valid range (see CCCCAAAAVVVVEEEEAAAATTTTSSSS, section
  50.                     below).
  51.  
  52. NNNNOOOOTTTTEEEESSSS
  53.      A thread application can find the thread limit using the _s_y_s_c_o_n_f()
  54.      function with the ____SSSSCCCC____TTTTHHHHRRRREEEEAAAADDDD____TTTTHHHHRRRREEEEAAAADDDDSSSS____MMMMAAAAXXXX option.
  55.  
  56. CCCCAAAAVVVVEEEEAAAATTTTSSSS
  57.      The POSIX thread model is incompatible with the _ssss_pppp_rrrr_oooo_cccc(2) model of
  58.      threading.  Attempts to create a pthread process from a sproc program
  59.      will be rejected.
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. pppptttthhhhrrrreeeeaaaadddd____ccccrrrreeeeaaaatttteeee((((3333PPPP))))                                          pppptttthhhhrrrreeeeaaaadddd____ccccrrrreeeeaaaatttteeee((((3333PPPP))))
  71.  
  72.  
  73.  
  74.      Attempts to create a pthread process at a priority outside of the valid
  75.      range will be rejected.  Specifically, _w_e_i_g_h_t_l_e_s_s is not a valid pthread
  76.      priority.
  77.  
  78.      For more information about these and other limitations with the POSIX
  79.      thread model see _pppp_tttt_hhhh_rrrr_eeee_aaaa_dddd_ssss(5).
  80.  
  81. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  82.      pthread_attr_init(3P), pthread_attr_setscope(3P), pthread_exit(3P),
  83.      pthreads(5), setrlimit(2), sysconf(3C).
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.